google.load('maps', '2');
var map;

function initialize() {
	map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(37.4328, -122.077), 0);

	// The following line makes the map Earth-enabled by adding the
	// "Earth" button to the map type control. Note that you still
	// need to add a map type control (GMapTypeControl,
	// GMenuMapTypeControl, or GHierarchicalMapTypeControl) to the
	// the map (as is done below) for the "Earth" button and the rest
	// of the map type buttons to show up at all.
	map.addMapType(G_SATELLITE_3D_MAP);

	map.addControl(new GHierarchicalMapTypeControl());
	map.addControl(new GLargeMapControl());

	var marker = new GMarker(new GLatLng(37.4228, -122.085));
	GEvent.addListener(marker, "click", function() {
		var html = '<div style="width: 210px; padding-right: 10px">Hello world!<\/div>';
		marker.openInfoWindowHtml(html);
	});
	map.addOverlay(marker);

	var polyline = new GPolyline([new GLatLng(37.4419, -122.1419),
					new GLatLng(37.4219, -122.1219),
					new GLatLng(37.4319, -122.1119),
					new GLatLng(37.4119, -122.0919)], "#ff0000", 10);
	GEvent.addListener(polyline, "click", function(latlng) {
		var html = '<div style="width: 210px; padding-right: 10px">A polyline.<\/div>';
		map.openInfoWindowHtml(latlng, html);
	});
	map.addOverlay(polyline);
}
